package com.onemile.app;


import com.onemile.entity.PubConst;

import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.os.Handler;

public class UISplash extends Activity
{
   @Override
   public void onCreate(Bundle savedInstanceState)
   {
	  super.onCreate(savedInstanceState);
	  setContentView(R.layout.splash);

	  new Handler().postDelayed(new Runnable()
	  {
		 @Override
		 public void run()
		 {
			SharedPreferences sp = getSharedPreferences(PubConst.Setting.Setting, Activity.MODE_PRIVATE);
			boolean isFirst = sp.getBoolean(PubConst.Setting.FirstOpen, true);
			if (isFirst)
			{
			   Intent intent = new Intent();
			   intent.setClass(UISplash.this, UIGuide.class);
			   startActivity(intent);
			   finish();
			}
			else
			{
			   Intent intent = new Intent();
			   intent.setClass(UISplash.this, UIHome.class);
			   startActivity(intent);
			   finish();
			}
		 }
	  }, 300);
   }
}
